package zsw.singon;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.lang.reflect.Constructor;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang3.StringUtils;

import sun.misc.ProxyGenerator;

public class registerSigon {

	private static final Map<String, Object> mapCon = new ConcurrentHashMap<String, Object>();

	private registerSigon() {
	}

	public static registerSigon getInstans(String name) {

		try {
			if (mapCon.containsKey(name)) {
				return (registerSigon) mapCon.get(name);
			}
            synchronized (registerSigon.class) {
            	if (mapCon.get(name) == null) {
    				mapCon.put(name, Class.forName(name).newInstance());
    			}
			
            }
			
		} catch (Exception e) {

			e.printStackTrace();
		}

		return (registerSigon) mapCon.get(name);
	}

}
